home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / windows4 / stdm10.zip / README.TXT next >
Text File  |  1992-11-28  |  19KB  |  592 lines

  1.             Stdemo Player 1.0 
  2.         Copyright (c) 1992 Mik Kvitchko
  3.  
  4. -----------------------------
  5. | Mikhail Kvitchko          |
  6. | 289-D Crowells Road,      |
  7. | Highland Park, NJ 08904   |
  8. | USA                       |
  9. -----------------------------
  10.  
  11. This package consists of the following files:
  12.  
  13. README.TXT    - This File
  14. STHOOK.DLL    - Windows Input Messages Interception DLL
  15. STDEMO.EXE    - Stdemo Player Program
  16. SCRIPT.TXT    - Stdemo Player Example Script
  17.  
  18. What is this?
  19. =============
  20.  
  21. Stdemo Player is an application that you can use to create demos, 
  22. tutorials or manually prepare scripts to "play" them into any 
  23. Windows application. It allows you to write a script, which will 
  24. start one or several Windows application, perform a series of 
  25. keystrokes or mouse actions aimed to demonstrate the application or 
  26. to perform some pre-defined sequence of actions. While your script 
  27. is being "played", you can disable completely keyboard and mouse, 
  28. so that user will not be able to interfere with the running demo 
  29. and to cause a conflict. At certain points of you script you may 
  30. interrupt it in order to interact with user. These interactions 
  31. allow:
  32.  
  33. -    to show the "text" box with some explanatory text before 
  34.     script will continue ( this is the main idea of how demos
  35.     and tutorials are to be designed);
  36.  
  37. -    to show the "menu" box where user can select one of several 
  38.     choices, and therefore control the script's execution;
  39.  
  40. -    to show the "input" box, where user can answer questions and 
  41.     enter some text, which later can be used in script.
  42.  
  43. There are many varieties of these boxes in order to make your demo 
  44. flexible, and they can be forced to be shown in some convenient 
  45. places on the screen. Moreover, user can move them across the 
  46. screen to be able to see different parts of the covered windows.
  47.  
  48. Even if you are not interested in preparing demos, you may find 
  49. Stdemo Player useful. For example, you can replace your complete 
  50. Startup Group to the single Stdemo Player script which will launch
  51. all your "startup" applications, and even perform some initial 
  52. actions for every of them: set up default options, load files, etc.
  53.  
  54. How to play the script?
  55. ======================
  56.  
  57. When you run stdemo.exe without parameters, it looks for the file 
  58. "script.txt" in the current working directory, and if it is there - 
  59. "plays" it. 
  60.  
  61. Also you may pass the name of the script as a parameter to 
  62. stdemo.exe. This name may include the full path.
  63.  
  64.  
  65. How to write a script?
  66. ======================
  67.  
  68. Script is a plain ASCII text file. It may include:
  69.  
  70. -    keystrokes;
  71. -    commands;
  72. -    interaction breaks;
  73. -    comments.
  74.  
  75. Every keystroke, command or interaction break is a unit. Stdemo 
  76. Player reads units from the script one by one and executes them. 
  77. After one unit is executed, Stdemo Player waits for some time 
  78. (time-out tick, which can be set or changed at any point in the 
  79. script) and then executes the next unit. Time-out doesn't affect 
  80. the interaction breaks (which are "text", "menu" and "input" dialog 
  81. boxes). Once one of this boxes is shown - only user may continue or 
  82. stop script execution, selecting "Continue" or "Stop" button on the 
  83. box. Comments are ignored, as you may expect, and cause no time-out 
  84. delays.
  85.  
  86. 1. Keystrokes.
  87. --------------
  88.  
  89. Any text in the script which is not a command, interaction break or 
  90. comment is a set of keystrokes, i.e. every symbol of the text 
  91. causes a keystroke to be sent into the current window application 
  92. (see  below).
  93. There are also several special symbols which allow to simulate 
  94. different keyboard keys.
  95.  
  96. Any keystroke can be preceded by one or more special symbols 
  97. ("@" - Alt, "#" - Shift or/and "%" - Control) as you see in the 
  98. following example:
  99.  
  100. @A    Alt-A
  101. #A    Shift-A
  102. %A    Ctrl-A
  103. #%A    Shift-Ctrl-A
  104.  
  105. There are also many special keys which are coded by "escaping" them 
  106. with the "]". They are follows:
  107.  
  108. ]|    Down
  109. ]^    Up
  110. ]<    Left
  111. ]>    Right
  112. ]~    Tab
  113. ]!    Return
  114. ]-    PgUp
  115. ]+    PgDn
  116. ]\    Backspace
  117. ]Z    Esc
  118. ]I    Ins
  119. ]D    Del
  120. ]H    Home
  121. ]E    End
  122. ]0    F10
  123. ]1    F1
  124. ...........
  125. ]9    F9
  126. ]]    ]
  127. ]@    @
  128. ]%    %
  129. ]#    #
  130. ]:    :
  131. ]$    $
  132.  
  133. This is not a full set of the keyboard keys, as you may note - but 
  134. it covers most of usable ones (I hope).
  135.  
  136. 2. Commands.
  137. ------------
  138.  
  139. All commands start from the colon sign ":". Some of the commands 
  140. must be coded as a separate line in a script, others can be mixed 
  141. with the keystrokes. The rule of a thumb is: if a command has fixed 
  142. format or ends with the special separator - it can be placed 
  143. anywhere, otherwise it has to be coded as a separate line of the 
  144. script. The general format of a command is:
  145.     :<code><parameters>
  146. <code> is a single letter or some other symbol;
  147. <parameters> may vary; one parameter can be a letter, text or 
  148. number; parameters follow the code without blank, and in some cases 
  149. are separated one from another by the special separator "|".
  150.  
  151. The commands are:
  152.  
  153. :=x            set time-out tick to x milliseconds.
  154.             Default time-out is 1 millisecond.
  155.     Example:
  156.     :=1000    set time-out tick to 1 sec.
  157.  
  158. :T            skip 1 time-out tick.
  159.     Example:
  160.     abc:T:T:Tefg    enter "abc", then wait for three 
  161.             current time-out ticks, then enter
  162.             "efg".
  163.  
  164. :Dtext            change current directory to "text". 
  165.     Example:
  166.     :Dc:\windows\system
  167.  
  168. :(app-name parm|x    launch the application;
  169.             program name must include extension (for the 
  170.             security reason) and may include the full path;
  171.             parameters to the program can be passed, if 
  172.             needed (not required);
  173.             flag x may be coded as one digit 0..2 after the 
  174.             separator and affects the size of the
  175.             application window: 0 (default), 1(maximize),
  176.             2(minimize).
  177.     Examples:
  178.     :(notepad.exe
  179.     :(c:\windows\write.exe demo.wri
  180.     :(notepad.exe c:\stdemo\readme.txt|2
  181.  
  182. :)            kill the last application in stack (if exists).
  183.  
  184.     Note:    Stdemo Player allows to start several applications.
  185.         It keeps track of the applications being started in 
  186.         the internal stack ( max. 10 entries). When you start
  187.         a new application, the following keystrokes will be 
  188.         sent into the new application window, as it will
  189.         get focus after the launch. You must issue ":)" -
  190.         kill last application - command, even when you finish
  191.         the application using it's menu commands - so that
  192.         Stdemo Player could handle the stack of current
  193.         applications properly.
  194.         There is no command ( so far ) to switch focus from
  195.         one application to another. Though you can do this by
  196.         simulating mouse clicking in the proper window. Just
  197.         make sure that you close applications in the reverse
  198.         order as you started them, and issue correspondent
  199.         ":)" commands in the same reverse order.
  200.         
  201. :Iab            enable/disable Windows input;
  202.             parameter "a" must be coded as one digit:
  203.             0 - disable input, 1 - enable input;
  204.             parameter "b" is also 1 digit:
  205.             0 - temporarily, 1 - permanently.
  206.     Example:
  207.     :I10    enable input until the next interaction break.
  208.  
  209.     Note:    When stdemo starts, it disables Windows input
  210.         (keyboard and mouse buttons) in order to prevent
  211.         user's intervention into the actions being played.
  212.         When one of the interaction breaks occurs, the input
  213.         is partially restored to allow user interaction 
  214.         inside the dialog box only. When script continues,
  215.         the state is restored as it was before the break.
  216.         "Temporarily change the state of Windows input" means
  217.         "until the next interaction break occurs". Permanent
  218.         change affects all subsequent script play and can be 
  219.         changed with the next ":I" command only.
  220.  
  221. :Cab            show/hide Windows cursor;
  222.             parameter "a" must be coded as one digit:
  223.             0 - hide cursor, 1 - show cursor;
  224.             parameter "b" is also 1 digit:
  225.             0 - temporarily, 1 - permanently.
  226.     Example:
  227.     :C11    show Windows cursor until further ":C" command.
  228.  
  229.     Note:    When stdemo starts, it hides Windows cursor.
  230.         When one of the interaction breaks occurs, the cursor
  231.         is restored to allow user interaction inside the
  232.         dialog box only. When script continues, the state is
  233.         restored as it was before the break.
  234.         "Temporarily change the visibility of cursor" means
  235.         "until the next interaction break occurs". Permanent
  236.         change affects all subsequent script play and can be 
  237.         changed with the next ":C" command only.
  238.  
  239. :Ltext            assign the label "text" to the current point in
  240.             the script.
  241. :Gtext            goto label "text".
  242.  
  243.     Note:     these two commands apparently do not require
  244.         explanation. Just note that so far there is no
  245.         conditional "goto" command. So you can use ":G"
  246.         command to code the loop, or to skip part of the
  247.         script during debugging. Labels are required when
  248.         you program a "menu" interaction break (see below).
  249.  
  250. :$ntext        set variable n to "text" (n=0..9).
  251.     Example:
  252.     :$1Hello 
  253.     :$2, how are you?
  254.  
  255.     Note:    variables can be used among the keystrokes, i.e., 
  256.         using previous example, script "$1 Joe$2" will
  257.         play "Hello Joe, how are you?". Variables are 
  258.         extensively used in the "input" interaction breaks
  259.         (see below).
  260.  
  261.  
  262. The following commands are to be used when you want some mouse 
  263. actions to be played from your script. It is not always possible to 
  264. get a reliable results with the mouse actions, assuming that your 
  265. script can be played with different display drivers in different 
  266. Windows modes and display resolutions. In order to cope with this, 
  267. you must use "virtual" coordinates, i.e. before using any command 
  268. which has coordinates as a parameter, you have to set "virtual 
  269. screen/window size" and then all following coordinates must be 
  270. coded according to this size. When your script will be played, 
  271. Stdemo Player will determine the real current screen/window size, 
  272. and then adjust all your virtual coordinates according to 
  273. virtual/real ratio. You have to understand, that it is not a 
  274. perfect solution - for example, dialog boxes sizes are not 
  275. proportionally changed for different display resolutions, they 
  276. depend on the size of the system font rather than on display mode. 
  277. But if you code your mouse actions inside the dialog box, based on 
  278. the dialog box virtual size - it will work. 
  279.  
  280. :Sx|y            set virtual screen/window size.
  281.     Example:
  282.     :S1024|768
  283.     :S100|50
  284.  
  285. :Oab            set coordinates origin.
  286.             parameter "a" must be coded as one letter:
  287.             S - screen, A - application main window,
  288.             F - current focus window;
  289.             parameter "b" is also 1 letter:
  290.             C - client area, W - window area.
  291.     Examples:
  292.     :OSW
  293.     :OAC
  294.     :OFW
  295.  
  296. :Mx|y|n        move mouse cursor to (x,y) in n steps.
  297.  
  298.     Examples:
  299.     :S200|200
  300.     :OAC
  301.     :C11
  302.     :M100|100|1    set cursor in the center of the client area
  303.             of the main application window.
  304.     :M0|200|100    move cursor in 100 steps to the bottom-left
  305.             corner of the client area.
  306.  
  307.     Note:    Make sure that your coordinates agree with the
  308.         current modes set in ":S" and ":O" commands.
  309.  
  310. :Bab            mouse button action.
  311.             parameter "a" must be coded as one letter:
  312.             L - left button, R - right button, M - middle;
  313.             parameter "b" must be coded as 1 digit:
  314.             1 - press, 0 - release, 2 - double-click.
  315.  
  316. :Kab            set keyboard state for some special keys.         
  317.             parameter "a" must be coded as one letter:
  318.             S - Shift key, C - Control key, A - Alt key;
  319.             parameter "b" must be coded as 1 digit:
  320.             1 - down, 0 - up.
  321.  
  322.     Example:
  323.     :KS1:BL1:BL0:KS0    click the left mouse button when the
  324.                 Shift key is down.
  325.  
  326.  
  327. 3. Interaction breaks.
  328. ----------------------
  329.  
  330. These are various dialog boxes which can be shown at any point of 
  331. you script, allowing therefore some interaction with user. There 
  332. are three classes of these boxes: "text", "menu" and "input". Each 
  333. class contains from 3 to 5 similar boxes, which vary by their size 
  334. and by the number of fields in them.
  335. All boxes are coded in the script differently, but the common 
  336. pattern is:
  337.  
  338. <header line>
  339. <one or more body lines>
  340. <end-of-box delimiter line>
  341.  
  342. 3.1 TEXT interaction break.
  343. +++++++++++++++++++++++++++
  344.  
  345. Every TEXT box has a single text field which fills the dominant 
  346. area of the box.
  347.  
  348. The header line is:
  349. :#sxy
  350.     parameter "s" defines the size and must be a letter:
  351.     S - small, M - medium, L - large, W - wide, N - narrow;
  352.     parameter x defines the position along the x-axis:
  353.     L - left adjusted, C - centered, R - right adjusted;
  354.     parameter y defines the position along the y-axis:
  355.     U - up adjusted, C - centered, D - down adjusted.
  356.  
  357. The body of this break consists from the text only, which will be 
  358. shown in the single text field of the box. Text may be coded as one 
  359. or more lines in the script, but it'll be placed continuously in 
  360. the box, applying word wrap. There are two special commands which 
  361. can be entered into the body of the TEXT box:
  362. .N    causes the following text start from a new line in a box;
  363. .S    causes to skip one line and continue to fill a box with the
  364.     following text.
  365.  
  366. The delimiter line is:
  367. #
  368.  
  369. Example:
  370.  
  371. :#NCC
  372. This is the narrow box, centered on the screen.
  373. .S
  374. This text starts after the empty line.
  375. .N
  376. This text starts from the beginning of the new line.
  377. #
  378.  
  379. 3.2 MENU interaction break.
  380. +++++++++++++++++++++++++++
  381.  
  382. Every MENU box has a header text field on a top and from 2 to 9 
  383. menu item fields ( radio buttons).
  384.  
  385. The header line is:
  386. :*sxy
  387.     parameter "s" defines the size and must be a letter:
  388.     S - small, M - medium, L - large;
  389.     parameter x defines the position along the x-axis:
  390.     L - left adjusted, C - centered, R - right adjusted;
  391.     parameter y defines the position along the y-axis:
  392.     U - up adjusted, C - centered, D - down adjusted.
  393.  
  394. The body of this break consists from the text which will fill the 
  395. header text field of the menu box, and two or more menu lines. 
  396. Text may be coded as one or more lines anywhere in the body; it'll 
  397. be placed continuously in the header field, using word wrap if 
  398. appropriate. Text line should not start from a digit.
  399. Every menu item line has the following format:
  400.  
  401. nlabel|item text      
  402.  
  403. "n" is a menu item field number (1..9);
  404. "label" - is a label in the script where control will be passed if 
  405. this item will be selected from the menu box.
  406. "item text" is a text to fill the menu item field.
  407.  
  408. The delimiter line is:
  409. *
  410.  
  411. Notes:        1. The "small" menu box has 2 menu fields, the         
  412.            "medium" - 5 fields, and the large - 9 fields.
  413.         
  414.         2. If there is no text for the header - the header     
  415.            field will not be shown in the box.
  416.         
  417.         3. If there is no lines for some menu items - the     
  418.            correspondent item field will not be shown in the 
  419.            box.
  420. Example:
  421.  
  422. :*MCU
  423. Select one of the three:
  424. 1l1|This is the first item
  425. 3l2|This is the second item
  426. 5l3|This is the third item
  427. *
  428. :Ll1
  429. :#SCC
  430. You've selected the first.
  431. #
  432. :Gcont
  433. :Ll2
  434. :#SCC
  435. You've selected the second.
  436. #
  437. :Gcont
  438. :Ll3
  439. :#SCC
  440. You've selected the third.
  441. #
  442. :Lcont
  443.  
  444.  
  445. 3.3 INPUT interaction break.
  446. ++++++++++++++++++++++++++++
  447.  
  448. Every INPUT box has a header text field on a top of the box and 
  449. from 1 to 9 edit fields. The small box has only one edit field, the 
  450. medium has 5, and the large has 9. Every edit field in the medium 
  451. and large INPUT boxes has the correspondent description field on a 
  452. left of the every edit field.
  453.  
  454. The header line is:
  455. :%sxy
  456.     parameter "s" defines the size and must be a letter:
  457.     S - small, M - medium, L - large;
  458.     parameter x defines the position along the x-axis:
  459.     L - left adjusted, C - centered, R - right adjusted;
  460.     parameter y defines the position along the y-axis:
  461.     U - up adjusted, C - centered, D - down adjusted.
  462.  
  463. The body of this break consists from the text which will fill the 
  464. header text field of the menu box, and one or more input lines. 
  465. Text may be coded as one or more lines anywhere in the body; it'll 
  466. be placed continuously in the header field, using word wrap if 
  467. appropriate. Text line should not start from a digit.
  468. Every input line has the following format:
  469.  
  470. nDescription_Text      
  471.  
  472. "n" is a input field number (1..9); the correspondent input field 
  473. will be filled with the current value of the variable $n. If the 
  474. variable is empty - the field will also be empty.
  475.  
  476. "Description_Text" is a text to fill the description field for the 
  477. "n"-th input field.
  478.  
  479. The delimiter line is:
  480. %
  481.  
  482. Notes:        1. The "small" input box has 1 edit field, the         
  483.            "medium" - 5 fields, and the large - 9 fields.
  484.         
  485.         2. If there is no text for the header - the header     
  486.            field will not be shown in the box.
  487.         
  488.         3. If there is no line for some edit field - the     
  489.            correspondent edit and description fields will not
  490.            be shown in the box.
  491.  
  492.         4. After user entered some text in the input field - 
  493.            this text will be assigned to the correspondent     
  494.            variable ($1..$9).
  495. Example:
  496.  
  497. :(notepad.exe|1
  498. :$2John
  499. :%MCU
  500. Please correct your name.
  501. 2Your first name:
  502. 4Your last name:
  503. %
  504. Hello, $2 $4!
  505. :#SRD
  506. Is my greeting correct?
  507. #
  508. :)
  509.  
  510.  
  511. 4. Comments.
  512. ------------
  513.  
  514. Any line in the script outside the interaction breaks, which starts 
  515. from "//" is being treated as a comment.
  516.  
  517.  
  518. Future.
  519. =======
  520.  
  521. I'm sure you noticed that the program can be further extended
  522. ( for example, auto recorder would not do any harm ). Please,
  523. share your ideas with me, if you are interested.
  524.  
  525. Acknowledgments.
  526. ================
  527.  
  528. 1. Thanks to CompuServe and all participants of the WinSdk
  529.    forum - you were my teachers, when I started programming
  530.    Windows half a year ago.
  531.  
  532. 2. Thanks to Brent Rector, whose book "Developing Windows 3
  533.    Applications" (and once he personally) helped me along
  534.    my way of learning Windows.
  535.  
  536. 3. Thanks to my employers and friends Ken Winston and Michael
  537.    Markov; their enthusiasm kept me busy enough to grow.
  538.  
  539. Legal Stuff.
  540. ============
  541.  
  542. Stdemo Player is shareware.
  543.  
  544. If you like Stdemo Player, a registration fee of $20 - $30 would 
  545. be appreciated. I think, it is a fair price. But if you think that 
  546. the price is too low or too high - send me whatever amount you 
  547. find appropriate.
  548.  
  549. When you register, I can replace irrelevant "MIK" icon on all 
  550. dialog boxes to another one (you may send your icon to me) and
  551. will send the updated copy to you. Provided that your cash will 
  552. cover at least diskettes, time and postal expenses. If you support 
  553. my efforts, I can even customize Stdemo Player according to your 
  554. needs.
  555.  
  556. Please, send check or money order to:
  557.  
  558. Mikhail Kvitchko
  559. 289-D Crowells Road,
  560. Highland Park, NJ 08904
  561. USA
  562.  
  563.  
  564. Comments? Questions? Suggestions? 
  565. I will be glad if you contact me at:
  566.  
  567. Internet:    mik%success@rna.rockefeller.edu
  568. CompuServe:     Mik Kvitchko [71250,1660] (checked irregularly).
  569.  
  570. You may make copies of this program and give them to others as 
  571. long as all files are included and unaltered.
  572.  
  573.  
  574. Disclaimer.
  575. ===========
  576. I've taken great care to ensure the program performs as stated. 
  577. Still, I cannot guarantee this will be the case on every system. 
  578. As such, you agree NOT to hold me responsible for ANY damages 
  579. directly or indirectly related to the use of Stdemo Player. The 
  580. author of this software is not responsible for any damage due to 
  581. use of this program.  This software is provided without warrantee 
  582. of any kind.
  583.  
  584. A Personal Note...
  585. ==================
  586.  
  587. I write C better than English. Please excuse my mistakes and funny 
  588. constructions in the above text, if you noted some (I'm sure, you 
  589. did!). Especially articles... They are incomprehensible!
  590.  
  591. Thanks!
  592.